import request from "@/utils/request";

// 查询数据权限树形数据源
export function menuTree(query) {
  return request({
    url: "plat/dataPermission/menuTree",
    method: "get",
    params: query
  });
}

// 查询数据权限树形数据源
export function sublist(query) {
  return request({
    url: "plat/dataPermission/sublist",
    method: "get",
    params: query
  });
}

// 分配数据权限
export function assign(objectGuid, dataPermissions) {
  return request({
    url: `plat/dataPermission/${objectGuid}/assign`,
    method: "post",
    data: dataPermissions
  });
}

export default {
  menuTree,
  sublist,
  assign
};
